﻿/*
 * Created by SharpDevelop.
 * User: ratul
 * Date: 3/5/2010
 * Time: 12:04 AM
 * 
 * To change this template use Tools | Options | Coding | Edit Standard Headers.
 */

using System;

namespace H264Impl.NET.Sample
{
	/// <summary>
	/// Description of SampleFactory.
	/// </summary>
	public static class SampleArrayFactory
	{
		public enum SamplingType
		{
			MONOCHROME,
			C422,
			C444,
			C420,
			C400
		}
		
		static SampleArrayFactory()
		{
		}

		public static SampleArray createSampleArray(SamplingType samplingType, UInt32 blockWidth, UInt32 blockHeight, bool separateColorPlane)
		{
			SampleArray sampleArray;
			
			if(samplingType == SampleArrayFactory.SamplingType.MONOCHROME)
				sampleArray = new MonochromeSampleArray(blockWidth, blockHeight, separateColorPlane);
			else if(samplingType == SampleArrayFactory.SamplingType.C444)
				sampleArray = new  C444SampleArray(blockWidth, blockHeight, separateColorPlane);
			else if(samplingType == SampleArrayFactory.SamplingType.C422)
				sampleArray = new  C422SampleArray(blockWidth, blockHeight, separateColorPlane);
			else if(samplingType == SampleArrayFactory.SamplingType.C420)
				sampleArray = new  C420SampleArray(blockWidth, blockHeight, separateColorPlane);
			else
				throw new ArgumentException();
			
			return sampleArray;
		}
	}
}
